local qinfeng = fk.CreateSkill{
    name = "lingling__qinfeng"
}
Fk:loadTranslationTable{
    ["lingling__qinfeng"] = "擒风",
    [":lingling__qinfeng"] = "每轮限两次，当你造成或受到伤害后，你可以获得对方一张牌。",
    ["#lingling__qinfeng-invoke"] = "是否发动 擒风，获得 %dest 一张牌？",
    ["#lingling__qinfeng"] = "擒风：获得 %dest 一张牌",
}

qinfeng:addEffect(fk.Damage,{
    anim_type = "control",
    can_trigger = function (self, event, target, player, data)
        return target == player and player:hasSkill(qinfeng.name) and player:usedSkillTimes(qinfeng.name, Player.HistoryRound) < 2 and data.to and not data.to.dead and data.to ~= player and not data.to:isNude()
    end,
    on_cost = function (self, event, target, player, data)
        if player.room:askToSkillInvoke(player,{
            skill_name = qinfeng.name,
            prompt = "#lingling__qinfeng-invoke::"..data.to.id
        }) then
            return true
        end
    end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        local card = room:askToChooseCard(player, {
            target = data.to,
            flag = "he",
            skill_name = qinfeng.name,
            prompt = "#lingling__qinfeng::"..data.to.id
        })
        room:obtainCard(player, card, false, fk.ReasonJustMove, player, qinfeng.name)
    end,
})

qinfeng:addEffect(fk.Damaged,{
    anim_type = "control",
    can_trigger = function (self, event, target, player, data)
        return target == player and player:hasSkill(qinfeng.name) and player:usedSkillTimes(qinfeng.name, Player.HistoryRound) < 2 and data.from and not data.from.dead and data.from ~= player and not data.from:isNude()
    end,
    on_cost = function (self, event, target, player, data)
        if player.room:askToSkillInvoke(player,{
            skill_name = qinfeng.name,
            prompt = "#lingling__qinfeng-invoke::"..data.from.id
        }) then
            return true
        end
    end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        local card = room:askToChooseCard(player, {
            target = data.from,
            flag = "he",
            skill_name = qinfeng.name,
            prompt = "#lingling__qinfeng::"..data.from.id
        })
        room:obtainCard(player, card, false, fk.ReasonJustMove, player, qinfeng.name)
    end,
})

return qinfeng